<template>
	<view class="message-item" :class="messageInfo.isSender?'sender':'receiver'">
		<view class="message-time" v-if="isShowDate">
			{{$utils.messageTimeFormat(Number(messageInfo.time))}}
		</view>
		<view class="message-main">
			<!-- 用户头像 -->
			<view class="user-avatar-container">
				<u-image class="user-avatar" mode="aspectFill" :src="messageInfo.avatar" width="100%"
					height="100%"></u-image>
			</view>
			<!-- 信息内容主体 -->
			<view class="message-content-main">
				<!-- 用户名 -->
	<!-- 			<view class="user-name">
					{{messageInfo.ext.userName}}
				</view> -->
				<view class="message-content-container">
					<!-- 消息内容，不同消息种类更改此模块 -->
					<!-- 文本消息 -->
					<view class="message-content">
						{{messageInfo.data}}
						<view class="link" v-if="messageInfo.isShowLink">
							请选择以下成为会员方式：↓↓↓
						</view>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {}
		},
		props: {
			//消息详情信息
			messageInfo: {
				type: Object,
				required: true,
			},
			//是否显示日期
			isShowDate: {
				type: Boolean
			},
		},
		methods: {}
	}
</script>

<style scoped lang="scss">
	@import "./messageItem.scss";
</style>
